package com.zh.note.huawei.twohundred.分积木;

import java.util.Scanner;

/**
 * @Author: zhanghuan
 * @date: 2023/9/6 14:14
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int temp = 0;
        int sum = 0;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if (x < min) {
                min = x;
            }
            temp ^= x;
            sum += x;
        }
        if (temp == 0) {
            System.out.println(sum - min);
        } else {
            System.out.println("NO");
        }
    }
}
